using System;
using System.Collections.Generic;

using Gtk;

namespace Dashboard.Latte {

	public class SidebarGroup : Gtk.VBox {

		private Label label = null;
		private VBox box = null;

		public SidebarGroup (string name) : base (false, 10)
		{
			label = new Label ();
			label.Markup = "<b>" + name + "</b>";
			label.Xalign = 0.0f;
			PackStart (label, false, true, 0);

			Gtk.Alignment alignment = new Gtk.Alignment (0.1f, 0.5f, 0.0f, 0.0f);
			PackStart (alignment, false, true, 0);
			
			box = new VBox (true, 0);
			alignment.Add (box);
		}

		public void AddAction (ActionItem item)
		{
			box.PackStart (item, false, true, 0);
		}

		public void Clear ()
		{
			foreach (Widget widget in box.Children)
				box.Remove (widget);
		}

		public string Title {
			set { label.Text = value; }
		}
	}
}